package com.gjy.sb.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.TimeUnit;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-06-04 17:26:07
 */
@RequestMapping("/interceptor")
@RestController
public class InterceptorController {

    @GetMapping("/now")
    public String getTimeNow() throws InterruptedException {
        TimeUnit.SECONDS.sleep(2);
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss"));
    }

}
